<template>
  <div class="product-add mt30">
    <!--form表单-->
    <el-form size="small" ref="form" :model="form" label-width="200px">
      <div class="common-form">分销中心页面</div>
      <el-form-item label="页面标题 ">
        <el-input
          v-model="form.index.title"
          placeholder="分销中心"
          class="max-w460"
        ></el-input>
        <div class="tips">默认：分销中心</div>
      </el-form-item>
      <el-form-item label="非分销商提示 ">
        <el-input
          v-model="form.index.notAgent"
          placeholder="您还不是分销商，请先提交申请"
          class="max-w460"
        ></el-input>
      </el-form-item>
      <el-form-item label="申请成为分销商 "
        ><el-input
          v-model="form.index.applyNow"
          placeholder="立即加入"
          class="max-w460"
        ></el-input
      ></el-form-item>
      <el-form-item label="推荐人 "
        ><el-input
          v-model="form.index.referee"
          placeholder="推荐人"
          class="max-w460"
        ></el-input
      ></el-form-item>
      <el-form-item label="可提现佣金 "
        ><el-input
          v-model="form.index.money"
          placeholder="可提现"
          class="max-w460"
        ></el-input
      ></el-form-item>
      <el-form-item label="待提现佣金  "
        ><el-input
          v-model="form.index.freezeMoney"
          placeholder="待提现"
          class="max-w460"
        ></el-input
      ></el-form-item>
      <el-form-item label="已提现金额"
        ><el-input
          v-model="form.index.totalMoney"
          placeholder="已提现金额"
          class="max-w460"
        ></el-input
      ></el-form-item>
      <el-form-item label="去提现"
        ><el-input
          v-model="form.index.cash"
          placeholder="去提现"
          class="max-w460"
        ></el-input
      ></el-form-item>

      <div class="common-form">申请成为分销商页面</div>
      <el-form-item label="页面标题">
        <el-input
          v-model="form.apply.title"
          placeholder="申请成为分销商"
          class="max-w460"
        ></el-input>
        <div class="tips">默认：申请成为分销商</div>
      </el-form-item>
      <el-form-item label="请填写申请信息"
        ><el-input
          v-model="form.apply.title"
          placeholder="请填写申请信息"
          class="max-w460"
        ></el-input
      ></el-form-item>
      <el-form-item label="分销商申请协议"
        ><el-input
          v-model="form.apply.license"
          placeholder="分销商申请协议"
          class="max-w460"
        ></el-input
      ></el-form-item>
      <el-form-item label="申请成为经销商"
        ><el-input
          v-model="form.apply.submit"
          placeholder="申请成为经销商"
          class="max-w460"
        ></el-input
      ></el-form-item>
      <el-form-item label="审核中提示信息">
        <el-input
          v-model="form.apply.waitAudit"
          placeholder="您的申请已受理，正在进行信息核验，请耐心等待。"
          class="max-w460"
        ></el-input>
      </el-form-item>
      <el-form-item label="去商城逛逛"
        ><el-input
          v-model="form.apply.gotoMall"
          placeholder="去商城逛逛"
          class="max-w460"
        ></el-input
      ></el-form-item>

      <div class="common-form">分销订单页面</div>
      <el-form-item label="页面标题">
        <el-input
          v-model="form.order.title"
          placeholder="分销订单"
          class="max-w460"
        ></el-input>
        <div class="tips">默认：分销订单</div>
      </el-form-item>
      <el-form-item label="全部"
        ><el-input
          v-model="form.order.all"
          placeholder="全部"
          class="max-w460"
        ></el-input
      ></el-form-item>
      <el-form-item label="未结算"
        ><el-input
          v-model="form.order.unsettled"
          placeholder="未结算"
          class="max-w460"
        ></el-input
      ></el-form-item>
      <el-form-item label="已结算"
        ><el-input
          v-model="form.order.settled"
          placeholder="已结算"
          class="max-w460"
        ></el-input
      ></el-form-item>

      <div class="common-form">我的团队页面</div>
      <el-form-item label="页面标题">
        <el-input
          v-model="form.team.title"
          placeholder="我的团队"
          class="max-w460"
        ></el-input>
        <div class="tips">默认：我的团队</div>
      </el-form-item>

      <el-form-item label="团队总人数"
        ><el-input
          v-model="form.team.totalTeam"
          placeholder="团队总人数"
          class="max-w460"
        ></el-input
      ></el-form-item>
      <el-form-item label="一级团队"
        ><el-input
          v-model="form.team.first"
          placeholder="一级团队"
          class="max-w460"
        ></el-input
      ></el-form-item>
      <el-form-item label="二级团队"
        ><el-input
          v-model="form.team.second"
          placeholder="二级团队"
          class="max-w460"
        ></el-input
      ></el-form-item>
      <el-form-item label="三级团队"
        ><el-input
          v-model="form.team.third"
          placeholder="三级团队"
          class="max-w460"
        ></el-input
      ></el-form-item>

      <div class="common-form">提现明细页面</div>
      <el-form-item label="页面标题">
        <el-input
          v-model="form.cashList.title"
          placeholder="提现明细"
          class="max-w460"
        ></el-input>
        <div class="tips">默认：提现明细</div>
      </el-form-item>
      <el-form-item label="全部"
        ><el-input
          v-model="form.cashList.all"
          placeholder="全部"
          class="max-w460"
        ></el-input
      ></el-form-item>
      <el-form-item label="审核中"
        ><el-input
          v-model="form.cashList.apply10"
          placeholder="审核中"
          class="max-w460"
        ></el-input
      ></el-form-item>
      <el-form-item label="审核通过"
        ><el-input
          v-model="form.cashList.apply20"
          placeholder="审核通过"
          class="max-w460"
        ></el-input
      ></el-form-item>
      <el-form-item label="已打款"
        ><el-input
          v-model="form.cashList.apply40"
          placeholder="已打款"
          class="max-w460"
        ></el-input
      ></el-form-item>
      <el-form-item label="驳回"
        ><el-input
          v-model="form.cashList.apply30"
          placeholder="驳回"
          class="max-w460"
        ></el-input
      ></el-form-item>

      <div class="common-form">申请提现页面</div>
      <el-form-item label="页面标题">
        <el-input
          v-model="form.cashApply.title"
          placeholder="申请提现"
          class="max-w460"
        ></el-input>
        <div class="tips">默认：申请提现</div>
      </el-form-item>
      <el-form-item label="可提现佣金"
        ><el-input
          v-model="form.cashApply.capital"
          placeholder="可提现佣金"
          class="max-w460"
        ></el-input
      ></el-form-item>
      <el-form-item label="提现金额"
        ><el-input
          v-model="form.cashApply.money"
          placeholder="提现金额"
          class="max-w460"
        ></el-input
      ></el-form-item>
      <el-form-item label="请输入要提取的金额">
        <el-input
          v-model="form.cashApply.moneyPlaceholder"
          placeholder="请输入要提取的金额"
          class="max-w460"
        ></el-input>
      </el-form-item>
      <el-form-item label="最低提现佣金"
        ><el-input
          v-model="form.cashApply.minMoney"
          placeholder="最低提现佣金"
          class="max-w460"
        ></el-input
      ></el-form-item>
      <el-form-item label="提交申请"
        ><el-input
          v-model="form.cashApply.submit"
          placeholder="提交申请"
          class="max-w460"
        ></el-input
      ></el-form-item>

      <div class="common-form">推广二维码</div>
      <el-form-item label="页面标题">
        <el-input
          v-model="form.qrcode.title"
          placeholder="推广二维码"
          class="max-w460"
        ></el-input>
        <div class="tips">默认：推广二维码</div>
      </el-form-item>

      <!--提交-->
      <div class="common-button-wrapper">
        <el-button
          size="small"
          type="primary"
          @click="onSubmit"
          :loading="loading"
          >提交</el-button
        >
      </div>
    </el-form>
  </div>
</template>

<script>
import PlusApi from "@/api/plus.js";

export default {
  data() {
    return {
      /*form表单数据*/
      form: {},
      /*是否正在加载*/
      loading: false,
    };
  },
  props: {
    settingData: Object,
  },
  created() {
    this.form = this.settingData.words;
  },

  methods: {
    /*提交表单*/
    onSubmit() {
      let self = this;
      let params = self.form;
      self.loading = true;
      PlusApi.words(params, true)
        .then((data) => {
          self.loading = false;
          ElMessage({
            message: "恭喜你，设置成功",
            type: "success",
          });
        })
        .catch((error) => {
          self.loading = false;
        });
    },
  },
};
</script>

<style>
.tips {
  color: #ccc;
}
</style>
